package com.ugoodtech.mdcc.core.repository;

import com.ugoodtech.mdcc.core.domain.CustomerRegularReport;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

public interface CustomerRegularReportRepository extends PagingAndSortingRepository<CustomerRegularReport, Long>
        , QueryDslPredicateExecutor<CustomerRegularReport> {

    @Query("from CustomerRegularReport where customer_report_id=:reportId and deleted=false and enabled=true")
    CustomerRegularReport findByCustomerReportId(@Param("reportId") Long reportId);

    @Query("from CustomerRegularReport where regular_report_id=:regularReportId and deleted=false")
    CustomerRegularReport findByRegularReportIdNoCheckEnable(@Param("regularReportId") Long regularReportId);

}
